]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Downscale icon size when comparing to defaults
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 3 Apr 2020 18:28:57 +0000 (15:28 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 3 Apr 2020 19:04:40 +0000 (16:04 -0300)
The return value of st_theme_node_lookup_length() is scaled according
to the scale factor. IconGrid.ICON_SIZE is not. However, when BaseIcon
tries to fetch the CSS value for "icon-size" (which returns a scaled
value), it uses it as-is, mixing the two coordinate systems.

Use a single coordinate system (unscaled sizes) in IconGrid.BaseIcon.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1175

js/ui/iconGrid.js

index 25cd1409927a929554610af3b54bb3764d4b8e86..69c3fa52d4ef65d22c53e92f73f6fa6d0de42c19 100644 (file)
@@ -114,8 +114,11 @@ class BaseIcon extends St.Bin {
         if (this._setSizeManually) {
             size = this.iconSize;
         } else {
+            const { scaleFactor } =
+                St.ThemeContext.get_for_stage(global.stage);
+
             let [found, len] = node.lookup_length('icon-size', false);
-            size = found ? len : ICON_SIZE;
+            size = found ? len / scaleFactor : ICON_SIZE;
         }
 
         if (this.iconSize == size && this._iconBin.child)